﻿using Microsoft.Xna.Framework;

namespace Microsoft.Goldenlight.Framework.Scene
{
    /// <summary>
    /// 	Interface which provides basic functionality for 2D game objects.
    /// </summary>
    public interface ISceneObject2D : ISceneContainerObject
    {
        #region Scene Properties

        /// <summary>
        /// 	The scene graph the scene object is in.
        /// </summary>
        SceneGraph2D SceneGraph
        {
            get;
        }

        /// <summary>
        /// 	Group of this object. This is used for container queries to cull out objects we are not interested in.
        /// </summary>
        Group Group
        {
            get;
        }

        /// <summary>
        /// 	True if object should be rendered.
        /// </summary>
        bool Visible
        {
            get;
        }

        /// <summary>
        /// 	2D transform of object.
        /// </summary>
        Matrix Transform
        {
            get;
        }

        #endregion

        #region 2D Properties

        /// <summary>
        /// 	Indicates if the scene object can be picked up by mouse.
        /// </summary>
        bool PickingAllowed
        {
            get;
        }

        /// <summary>
        /// 	The reference point for sorting a scene object within a layer.
        /// </summary>
        Vector2 SortPoint
        {
            get;
        }

        /// <summary>
        /// 	World-space rectangle bounding our object.
        /// </summary>
        BoundingRectangle ClipRectangle
        {
            get;
        }

        /// <summary>
        /// 	World-space rectangle bounding our object for collision.
        /// </summary>
        BoundingRectangle CollisionClipRectangle
        {
            get;
        }

        #endregion

        #region Layer Properties

        /// <summary>
        /// 	Layer to draw scene object on. Lower numbered layers are drawn on top.
        /// </summary>
        int Layer
        {
            get;
        }

        /// <summary>
        /// 	LayerMask is used for collision checking. The layer mask is determined by setting the bit corresponding with the layer (layers outside the range of 0..31 are treated as Layer % 32).
        /// </summary>
        uint LayerMask
        {
            get;
        }

        /// <summary>
        /// 	Order of object within a layer. This is a read-only property used when rendering to make sure objects are rendered in the same order from frame to frame.
        /// </summary>
        int OrderInLayer
        {
            get;
        }

        /// <summary>
        /// 	Object is drawn at this z coordinate when rendering. This is a function of Layer and is used for rendering purposes only.
        /// </summary>
        float DepthInLayer
        {
            get;
            set;
        }

        #endregion

        #region Render Operations

        /// <summary>
        /// 	Render this scene object.
        /// </summary>
        /// <param name="renderState"> Scene render state helps determine how to render object. </param>
        void Render(RenderState renderState);

        #endregion
    }
}